using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameRoot : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        GameObjectPool.Instance.Init();
        MatchObjectPool.Instance.Init();
        EcsManager.Init();
        EcsManager.AllowLogicFrameLoop = true;
    }

    // Update is called once per frame
    void Update()
    {
        EcsManager.Update();

        if (Input.GetKeyDown(KeyCode.A))
        {
            LogicApi.CreateBoard(EcsManager.EcsContexts.logic, 9, 9);
            EcsManager.AllowInputFrameLoop = true;
        }
        
        if (Input.GetKeyDown(KeyCode.B))
        {
            LogicApi.ResetBoard(EcsManager.EcsContexts.logic, 9, 9);
        }
        
        if (Input.GetKeyDown(KeyCode.C))
        {
            EcsManager.LogicFrame = 3;
        }
        
        if (Input.GetKeyDown(KeyCode.D))
        {
            Time.timeScale = 0;
        }
        
        if (Input.GetKeyDown(KeyCode.E))
        {
            Time.timeScale = 1;
        }
        
        if (Input.GetKeyDown(KeyCode.F))
        {
            Time.timeScale = 3;
        }
    }
}
